import request from '@/utils/request'

export const deleteDepartmentAPI = (id) => {
  return request.delete(`/company/department/${id}`)
}

export const updateDepartmentAPI = (data) => {
  return request.put(`/company/department/${data.id}`, data)
}

/**
 *
 * @param {*} id
 */
export const getDepartmentDetailAPI = (id) => {
  return request.get(`/company/department/${id}`)
}

/**
 * 新增子部门
 * @param {*} data 新增部门表单对象
 */
export const addDeptmentAPI = (data) => {
  return request.post('/company/department', data)
}

/**
 * 获取部门负责人列表
 */
export const getManagersAPI = () => {
  return request.get('/sys/user/simple')
}

/**
 * 获取部门列表
 */
export const getDepartmentsAPI = () => {
  return request.get('/company/department')
}
